package com.itheima01.day04;
/*
把100-999存入数组,求出水仙花数,并打印出来
 */
public class ShuiXianHua {
    public static void main(String[] args) {
        int[] arr = new int[900];
        int a = 100;
        int bai = 0,shi = 0,ge = 0;
        for (int i = 0; i < arr.length; i++) {
            arr[i] = a;
            a++;
            bai = arr[i]/100;
            shi = arr[i]/10%10;
            ge = arr[i]%10;
            if(bai*bai*bai+shi*shi*shi+ge*ge*ge == arr[i]) {
                System.out.println("水仙花数为:" + arr[i]);
            }
        }
    }
}
